package com.fz.action;

import lombok.Data;

/**
 * Created by webrx on 2017-09-13.
 */
@Data
public class LoginAction {
    private String uname;
    private String pass;

    //不进视图，仅在控制台打印可以这样写
   /* public String execute(){
        System.out.println("账号是："+uname);
        System.out.println("密码是："+pass);
        return null;
    }*/
    public String execute(){
        System.out.println("账号是："+uname);
        System.out.println("密码是："+pass);
        //定义一个视图变量，正确进成功视图，错误进失败视图
        String result ="success";
        //原来endwith也有比较字符串是否相等的功能
        if(!("admin".endsWith(uname) && "123".equals(pass))){
            result = "fail";
        }
        return result;
    }
}
